
package com.example.demo.mapper;


import com.example.demo.entity.req.LawsDetailReq;
import com.example.demo.entity.res.LawsDetailRes;
import com.example.demo.entity.table.LawsContent;
import com.example.demo.entity.table.LawsList;
import com.example.demo.entity.req.LawsListsReq;
import com.example.demo.entity.req.updateLawContentReq;
import com.example.demo.entity.req.updateLawInfoReq;
import com.example.demo.entity.req.addLawReq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

@Mapper
public interface LawMapper {
    //获取表格内容
    @Select("select * from ${TableName}")
    List<LawsContent> getLawTableContent(String TableName);

    //写入文章信息到laws_list表
    int insertLawsList(String id, String title, Date date);
    
    //写入内容到laws_detail表
    int insertLawsDetail(String id, String directory, String content);

    List<LawsList> getLawsLists( LawsListsReq req);

    //获取法规详情
    LawsDetailRes getLawsDetail(LawsDetailReq req);


    //更新法规内容和目录
    int updateLawContent(updateLawContentReq req);

    //更新法规信息
    int updateLawInfo(updateLawInfoReq req);

    //新增法规到laws_list表
    int addlawsList(addLawReq req);

    //新增法规到laws_detail表
    int addlawsDetail(addLawReq req);


    //删除法规
    int deleteLaws(List<String> ids);
    
    //删除法规详情
    int deleteLawsDetail(List<String> ids);

    //获取所有标签
    List<String> getAllTags();
}